<script setup>
import axios from 'axios';
import { onMounted, reactive, ref, getCurrentInstance } from 'vue'

let roleList =ref('');

onMounted(() => {
  onUnmounted(() => {
    const interval = setInterval(updateTime, 1000);
    clearInterval(interval);
  });
});
function Data() {
  axios({
    method: 'get',
    url: "http://localhost:8080/User/Data",

    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },

  }).then(function (result) {
    console.log(result.data)
    roleList = result.data
  })
}

Data()


</script>
<template>
    <button @click="handleClick"></button>
    {{roleList}}
    <ul>
      <template v-for = "item in roleList.data" :key = "roleList.id">
        <li style="list-style-type:none;" >
          {{ item.id }}
          {{ item.username }}
          {{ item.password }}
          {{ item.name }}
          {{ item.createdTime }}
          {{ item.createdBy }}
          {{ item.positionId }}
          {{ item.positionName }}
          {{ item.permissions }}
        </li>
      </template>
      <input   />
    </ul>

</template>
<style scoped>

</style>
